//
// Created by Administrator on 2023/11/12.
//
#include "iostream"

using namespace std;

int partition(int A[],int low,int high,int pivotPos){
    int pivot=A[pivotPos];
    A[pivotPos]=A[low];//把空位放在第一个，方便后续算法的进行。
    while(low<high){
        while(low<high&&A[high]>=pivot) high--;
        A[low]=A[high];
        while(low<high&&A[low]<=pivot) low++;
        A[high]=A[low];
    }
    A[low]=pivot;
    return low;
}

int main() {
    int n, k, pivotPos;
    cin >> n >> k;
    int A[n];
    for (int i = 0; i < n; ++i) {
        cin >> A[i];
        if (A[i] == k) pivotPos = i;
    }
    int res= partition(A,0,n-1,pivotPos);
    cout<<res+1;

}